home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 11
/
FM Towns Free Software Collection 11.iso
/
t_os
/
tool
/
ein
/
fvi
/
fvimsg
/
msgmain.c
< prev
next >
Wrap
Text File
|
1995-09-27
|
3KB
|
145 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <egb.h>
#include <guidbg.h>
#include "fvimsg.h"
char *guiEgbPtr ;
int MSG_forceNum ;
int userFunc(apliId, messId, info, data)
int apliId;
int messId;
int info;
int data;
{
register int ret;
ret = ILLEGAL_FUNCTION;
switch(messId)
{
case GM_QUIT :
MMI_SendMessage( MSG_winId , MM_ERASE , 0 ) ;
ret = NOERR ;
break;
case GM_WAKE :
MMI_SendMessage( MSG_winId , MM_WAKE , 0 ) ;
ret = NOERR ;
break;
case GM_SLEEP :
MMI_SendMessage( MSG_winId , MM_SLEEP , 0 ) ;
ret = NOERR ;
break;
}
return ret ;
}
void main()
{
static MMICTRL mmi ;
extern int APL_init() ;
mmi.page0 = SCREENUNUSED | SCREENIGNORE ;
mmi.page1 = SCREENUNUSED ;
mmi.writePage = 0 ;
mmi.displayPage = SCREENAVAILABLE ;
mmi.priority = 0 ;
mmi.mode = SCREENAVAILABLE ;
mmi.width = SCREENEXPAND ;
mmi.size = 0 ;
mmi.ptr = NULL ;
mmi.asize = 0 ;
mmi.aptr = NULL ;
mmi.fr.lupx = 0 ;
mmi.fr.lupy = 0 ;
mmi.fr.rdwx = 0 ;
mmi.fr.rdwy = 0 ;
mmi.move.lupx = -16384 ;
mmi.move.lupy = -16384;
mmi.move.rdwx = 16383 ;
mmi.move.rdwy = 16383 ;
mmi.white = 15 ;
mmi.black = 8 ;
mmi.gray = 7 ;
mmi.xor = 7 ;
if (MMI_Open( &mmi ) == NOERR)
{
if (APL_init() == NOERR)
{
MMI_ExecSystem() ;
}
}
MMI_Close() ;
}
int APL_init()
{
extern MMIINIT initDataMSGSET ;
register int ret ;
guiEgbPtr = MMI_GetEgbPtr() ;
if ((ret = MMI_initHyper()) < 0) return ret ;
if ((ret = MMI_initDialogL40()) < 0) return ret ;
if ((ret = MMI_initWindowL40()) < 0) return ret ;
if ((ret = MMI_initMessageL40()) < 0) return ret ;
if ((ret = MMI_initButtonL40()) < 0) return ret ;
if ((ret = MMI_initDrawButtonL40()) < 0) return ret ;
if ((ret = MMI_initIconL40()) < 0) return ret ;
if ((ret = MMI_initToggleIconL40()) < 0) return ret ;
if ((ret = MMI_initTextL40()) < 0) return ret ;
if ((ret = MMI_Init(&initDataMSGSET)) < 0) return ret ;
MSG_searchDrive() ; // 使用できるドライブを検索
MSG_forceNum = 0 ; // 強制再描画リストのデフォルト
MTL_setFlagObj( MSG_selectForceId[0] , MS_TOGGLE ) ;
MTL_resetFlagObj( MSG_selectForceId[1] , (~MS_TOGGLE) ) ;
MMI_SendMessage( MSG_winId , MM_ATTACH , 1 , MMI_GetBaseObj() ) ;
MMI_SendMessage( MSG_winId , MM_WAKE , 0 ) ;
MMI_SendMessage(MMI_GetBaseObj(), MM_SHOW, 0) ;
MMI_SendMessage(MMI_GetBaseObj(), MM_SETEXEC, 1, userFunc);
MMI_CallMessage(MMI_GetApliId(), GM_TITLE, (int)"FViメッセージ送信", 0);
return NOERR ;
}
int MSG_searchDrive()
{
unsigned int i , drive , orgdrive ;
orgdrive = FM_GetCurrentDisk() ;
for ( i = 'A' ; i <= 'F' ; i++ )
{
FM_SelectDisk( i ) ;
drive = FM_GetCurrentDisk() ;
if ( ( drive != i ) || ( i == 'C' ) )
{
MTL_setAtrObj( MSG_drvSelBtnId[i-0x40] , MS_INACTIVEL40 ) ;
}
else
{
MTL_resetAtrObj( MSG_drvSelBtnId[i-0x40] , (~MS_INACTIVEL40) ) ;
}
}
FM_SelectDisk( orgdrive ) ;
return NOERR ;
}